#!/bin/bash

# 构建多服务容器镜像
echo "Building multi-service container image..."

# 设置镜像名称和标签
IMAGE_NAME="practice-platform/multi-service"
TAG="latest"

# 构建镜像
docker build -t ${IMAGE_NAME}:${TAG} .

# 检查构建结果
if [ $? -eq 0 ]; then
    echo "✅ Multi-service image built successfully!"
    echo "Image: ${IMAGE_NAME}:${TAG}"
    
    # 显示镜像信息
    echo ""
    echo "Image details:"
    docker images | grep ${IMAGE_NAME}
    
    # 显示镜像大小
    echo ""
    echo "Image size:"
    docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}" | grep ${IMAGE_NAME}
else
    echo "❌ Failed to build multi-service image"
    exit 1
fi 